package com.xbl.test1.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author xbl
 * @Description
 * @date 2019/1/27
 */
@RestController
@RequestMapping("/test1")
@RefreshScope
@Api(description = "test1相关controller")
public class Test1Controller {

    @Value("${config.env}")
    private String env;

    @ApiOperation("hello")
    @RequestMapping(value = "/hello",method = RequestMethod.GET)
    public String hello(@RequestParam(value = "name") String name){
        return "hello "+ name + "this is the second productor";
    }

    @ApiOperation("env")
    @RequestMapping(value = "/env",method = RequestMethod.GET)
    public String env(){
        return this.env;
    }


}
